const connection = require('../app/database')
class FileService {
    async created(filename, mimetype, size, id) {
        // 2.拼接statement
        const statement = 'INSERT INTO avatar (filename, mimetype, size, user_id) VALUES (?,?,?,?);'
        // 3.执行sql语句
        const [result] = await connection.execute(statement, [filename, mimetype, size, id])
        return result
    }
}
module.exports = new FileService()